//Check this
package pos.entity;


/**
 * This is the entity class for promotions (sales) 
 * @author Justin Hume
 */
public class PriceAdjustment {
    
    // -------------------------------------------------------------------------
    //  Private fields
    // -------------------------------------------------------------------------

    //Price adjustmentId
    private long priceAdjustmentId;
    //price adjustment amount
    private double priceAdjustmentAmount;
    //price adjusted by employee id
    private long adjustedByEmployeeId;
    //price adjustment type
    private int priceAdjustmentType;
    //price adjustment description
    private String priceAdjustmentDescription;
    //purchased item id
    private long purchasedItemId;
    //promotion id
    private long promotionId;

    // -------------------------------------------------------------------------
    //  Constructor
    // -------------------------------------------------------------------------
    public PriceAdjustment(long id, double adjAmt, long employeeId,
                           PriceAdjustmentType adjType, String desc, long purchasedItemId,
                           long promotionId) {
        
        this.priceAdjustmentId = id;
        this.priceAdjustmentAmount = adjAmt;
        this.adjustedByEmployeeId = employeeId;
        this.priceAdjustmentType = adjType.ordinal();
        this.priceAdjustmentDescription = desc;
        this.purchasedItemId = purchasedItemId;
        this.promotionId = promotionId;

    }

    // -------------------------------------------------------------------------
    //  Properties (get/set methods)
    // -------------------------------------------------------------------------
    /**
     * An enum with the available price adjustment types
     */
    public enum PriceAdjustmentType { COMPLAINT, GRATUITY, SPECIAL, MISC, _NODESCRIPTION_, _TAX_ }

    public long getAdjustedByEmployeeId() {
        return adjustedByEmployeeId;
    }

    public void setAdjustedByEmployeeId(long adjustedByemployeeId) {
        this.adjustedByEmployeeId = adjustedByemployeeId;
    }

    public double getPriceAdjustmentAmount() {
        return priceAdjustmentAmount;
    }

    public void setPriceAdjustmentAmount(double priceAdjustmentAmount) {
        this.priceAdjustmentAmount = priceAdjustmentAmount;
    }

    public String getPriceAdjustmentDescription() {
        return priceAdjustmentDescription;
    }

    public void setPriceAdjustmentDescription(String priceAdjustmentDescription) {
        this.priceAdjustmentDescription = priceAdjustmentDescription;
    }

    public long getPriceAdjustmentId() {
        return priceAdjustmentId;
    }

    public void setPriceAdjustmentId(long priceAdjustmentId) {
        this.priceAdjustmentId = priceAdjustmentId;
    }

    public PriceAdjustmentType getPriceAdjustmentType() {
        return PriceAdjustmentType.values()[priceAdjustmentType];
    }

    public void setPriceAdjustmentType(PriceAdjustmentType priceAdjustmentType) {
        this.priceAdjustmentType = priceAdjustmentType.ordinal();
    }

    public long getPromotionId() {
        return promotionId;
    }

    public void setPromotionId(long promotionId) {
        this.promotionId = promotionId;
    }

    public long getPurchasedItemId() {
        return purchasedItemId;
    }

    public void setPurchasedItemId(long purchasedItemId) {
        this.purchasedItemId = purchasedItemId;
    }
}
